package com.hmall.order.utils;

/**
 * @Author: cuiliangbo
 * @Date: 2022/6/15 12:30
 */
@SuppressWarnings("all")
public class ThreadLocal4UserId {

    private static ThreadLocal<Long> threadLocal = new ThreadLocal();

    public static void setUserId(Long userId){
        threadLocal.set(userId);
    }

    public static Long getUserId(){
        return threadLocal.get();
    }
    public static void removeUser(){
        threadLocal.remove();
    }
}

